Skip to content

[stable33] fix(AppStore/Fetcher): catch GenericFileException when reading cache file in Fetcher#60595

Merged
miaulalala merged 2 commits into
stable33from
backport/60286/stable33
May 20, 2026
Merged

[stable33] fix(AppStore/Fetcher): catch GenericFileException when reading cache file in Fetcher#60595
miaulalala merged 2 commits into
stable33from
backport/60286/stable33

Conversation

@backportbot
Copy link
Copy Markdown

@backportbot backportbot Bot commented May 20, 2026

Backport of PR #60286

@backportbot backportbot Bot requested a review from a team as a code owner May 20, 2026 00:52
@backportbot backportbot Bot requested review from Altahrim, CarlSchwan, leftybournes, miaulalala, provokateurin, salmart-dev and susnux and removed request for a team May 20, 2026 00:52
@backportbot backportbot Bot added this to the Nextcloud 33.0.4 milestone May 20, 2026
…Fetcher

When the appstore cache file exists but getContent() throws a
GenericFileException (I/O error or OS-level permission failure), explicitly
delete the file and recreate it before writing fresh data — mirroring the
NotFoundException recovery path. If deletion itself fails, return [] cleanly.

Previously, the unhandled exception caused the entire apps settings page to
crash. The new test covers both the recovery path and deletion failure.

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Attempt delete before logging the warning, so the warning only fires
  when we know recovery will succeed
- Log an error (not silently return) when delete itself fails
- Use catch (\Exception) without variable (PHP 8)
- Replace willReturnArgument(1) with explicit willReturn(true) in test
- Add blank lines between logical blocks in test for readability

Signed-off-by: Anna Larch <anna@nextcloud.com>
AI-Assisted-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@miaulalala miaulalala force-pushed the backport/60286/stable33 branch from aef3ac6 to b723c94 Compare May 20, 2026 08:00
@miaulalala miaulalala merged commit 9c5a5e7 into stable33 May 20, 2026
187 of 191 checks passed
@miaulalala miaulalala deleted the backport/60286/stable33 branch May 20, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants